package com.justnow.offer;

import java.util.ArrayList;

import java.util.Scanner;

/**
 * @author justnow
 * Created on 2020-09-12
 * Description
 */
public class Yfd01 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        int M = scanner.nextInt();
        ArrayList<Integer> array = new ArrayList<>();
        for (int i = 0; i < N; i++) {
            array.add(scanner.nextInt());
        }

        for (int i = 0; i < M; i++) {
            ArrayList<Integer> change = change(array);
            array = change;
        }
        for (Integer integer : array) {
            System.out.print(integer + " ");
        }

    }

    public static ArrayList<Integer> change(ArrayList<Integer> array) {
        int middle = array.size() / 2;
        ArrayList<Integer> left = new ArrayList<>();
        ArrayList<Integer> right = new ArrayList<>();
        ArrayList<Integer> result = new ArrayList<>();
        for (int i = 0; i < middle; i++) {
            left.add(array.get(i));
        }
        for (int i = middle; i < array.size(); i++) {
            right.add(array.get(i));
        }
        for (int i = 0; i < middle; i++) {
            result.add(right.get(i));
            result.add(left.get(i));
        }
        if (array.size() % 2 != 0) {
            result.add(right.get(right.size() - 1));
        }
        return result;
    }
}
